package JET;

import JET.editor.SelectionGroup;
import JET.geom.Rect2d;
import JET.geom.Vec2d;
import JET.graphics.GeomCursorTarget;
import JET.physics.Mass;
import JET.physics.bodies.Body;
import JET.physics.bodies.SpringBody;
import java.awt.Cursor;
import java.util.ArrayList;

/**
 *
 * @author raos
 */
public class EnvironmentCenter {

    // zmienne do zarzadzania "selection"
    public final SelectionGroup selectionGroup;
    public final SelectionGroup tempSelectGroup;
    public final SelectionGroup savedSelectionGroup1;
    public final SelectionGroup savedSelectionGroup2;
    public final SelectionGroup transformSelectionGroup;
    public final ArrayList<Vec2d> vecList;    // lista wektorów, do liniowej selekcji
    public Rect2d selectionRect;

    // graphic panel cursors
    public final Vec2d      scrCursor;
    public final Vec2d      engCursor;
    public final Vec2d      engCursorLastPos;
    public final Vec2d      engCursorMoveVec;

    public boolean          drawCursor;
    public GeomCursorTarget cursorTarger;

    // zmienne do trybow transformacji obiektow
    public final ArrayList<Mass> transformMassList;

    // zmienne do zarzadzania obiektami SpringBody
    public Body currentBody;
    
    public boolean followCamera = false;

    public EnvironmentCenter(Scene scene) {
        selectionGroup = new SelectionGroup(scene);
        tempSelectGroup = new SelectionGroup(scene);
        savedSelectionGroup1 = new SelectionGroup(scene);
        savedSelectionGroup2 = new SelectionGroup(scene);
        transformSelectionGroup = new SelectionGroup(scene);

        vecList = new ArrayList<Vec2d>();

        scrCursor = new Vec2d();
        engCursor = new Vec2d();
        engCursorMoveVec = new Vec2d();
        engCursorLastPos = new Vec2d();

        transformMassList = new ArrayList<Mass>();
    }

////////////////////////////////////////////////////////////////////////////////
//                       G E O M   C U R S O R                                //
////////////////////////////////////////////////////////////////////////////////
  
    public void setDrawCursor(boolean drawCursor) {this.drawCursor = drawCursor;}
    public boolean isDrawCursor() {return drawCursor;}
    public GeomCursorTarget getCursorTarger() {return cursorTarger;}
    public void setCursorTarger(GeomCursorTarget cursorTarger) {this.cursorTarger = cursorTarger;}

////////////////////////////////////////////////////////////////////////////////
//                     F O L L O W   C A M E R A                              //
////////////////////////////////////////////////////////////////////////////////

    public void setFollowCamera(boolean followCamera) {this.followCamera = followCamera;}
    public boolean isFollowCamera() {return followCamera;}

////////////////////////////////////////////////////////////////////////////////
//                             O T H E R                                      //
////////////////////////////////////////////////////////////////////////////////

    public void setCursor(Cursor cursor) {
        //GC.getJGraphicComponent(GUIC.getActualSceneName()).setCursor(cursor);
    }

    void clear() {
        transformMassList.clear();
        tempSelectGroup.clear();
        transformSelectionGroup.clear();
        selectionGroup.clear();
        savedSelectionGroup1.clear();
        savedSelectionGroup2.clear();
    }

}